<template>
	<view>
		<view class=" u-p-r-30 u-p-l-30 u-m-t-20" >
			<u-search placeholder="请输入关键词搜索" :clearabled="true" v-model="keyword" border-color="#606266" @custom="search" @search="search"></u-search>
		</view>
		<u-card padding="16" v-for="(item,index) in dataList" :key="index" @click="toGoods(item)">
			<view class="" slot="head">
				<view class="wrap">
					<u-row>
						<u-col span="7">
							<view class="u-m-t-5 weikaishi3 lanse">
								<span><u-icon name="order" size="30" labelSize="15px" labelColor="#000000"></u-icon>{{item.storageNumber}}</span>
							</view>
						</u-col>
						<u-col span="5" text-align="right" v-if="item.realNum > 0">
							<view class="u-m-t-5 jinxingzhong weikaishi3">
								<span>正在处理</span>
							</view>
						</u-col>
						<u-col span="5" text-align="right" v-else>
							<view class="u-m-t-5 weikaishi3">
								<span>未处理</span>
							</view>
						</u-col>
					</u-row>
					<u-row >
						<u-col span="12">
							<view class="weikaishi3">
								<span><u-icon name="account" size="29" labelSize="14px" labelColor="#000000" label="发货客户" color="#000000"></u-icon>：{{item.setUnit}}</span>
							</view>
						</u-col>
					</u-row>
					<u-row >
						<u-col span="12">
							<view class="weikaishi3">
								<span><u-icon name="home" size="29" labelSize="14px" labelColor="#000000" label="收货仓库"></u-icon>：{{item.getWarehouse}}</span>
							</view>
						</u-col>
					</u-row>
					<u-row >
						<u-col span="7" >
							<view class="weikaishi6">
								<span><u-icon name="clock" size="29" labelSize="14px" labelColor="#000000" label="数量" color="#000000"></u-icon>：{{item.putNum}}/{{item.putVolume}}方</span>
							</view>
						</u-col>
						<u-col span="5" v-if="item.putNum == item.realNum">
							<view class="weikaishi6 yiwancheng">
								<span><u-icon name="checkmark-circle" size="29" labelSize="14px" labelColor="#00c300" label="实入" color="#00c300"></u-icon>：{{item.realNum}}</span>
							</view>
						</u-col>
						<u-col span="5" v-else>
							<view class="weikaishi6">
								<span><u-icon name="checkmark-circle" size="29" labelSize="14px" labelColor="#000000" label="实入" color="#000000"></u-icon>：{{item.realNum}}</span>
							</view>
						</u-col>
					</u-row>
					<u-row >
						<u-col span="12">
							<view class="weikaishi6">
								<span><u-icon name="checkmark-circle" size="29" labelSize="14px" labelColor="#000000" label="商品数"></u-icon>：{{item.goodsNum}}</span>
							</view>
						</u-col>
					</u-row>
					<u-row >
						<u-col span="12">
							<view class="weikaishi6">
								<span><u-icon name="calendar" size="29" labelSize="14px" labelColor="#000000" label="预约时间"></u-icon>：{{item.yuyueTime}}</span>
							</view>
						</u-col>
					</u-row>
				</view>
			</view>
		</u-card>
		<view>
			<u-toast ref="uToast" />
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				dataList: [],
				keyword:'',
			}
		},
		onLoad() {
			//#ifdef H5 || APP-PLUS
			this.flex = 'u-flex'
			//#endif
		},
		onShow() {
			this.refresh()
		},
		onPullDownRefresh() {
			this.refresh()
			uni.stopPullDownRefresh()
		},
		methods: {
			toGoods(e){
				this.$Router.push({ 
					name: 'hx_storage_put_return_goods',
					params: { storageNumber:e.storageNumber},
				})
			},
			refresh(){
				uni.showLoading({
					title: '加载中...'
				})
				this.$http.post('/rest/HxStorageReturn/storagelist',{
				},{
					params: {
						keyword: this.keyword,
					},
					header: {
						'Authorization' :uni.getStorageSync('token'),
					}
				}).then(res => {
					this.dataList = res.data.data
				})
				uni.hideLoading()
			},
			search(e){
				this.refresh()
			},
		},
	}
</script>